package com.wx.chapter14;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/7/27 - 15:15
 */
public class Collection_ {
    //    @SuppressWarnings("all") 忽略所有的警告
    public static void main(String[] args) {
//        ArrayList arrayList = new ArrayList();
//        arrayList.add("jack");
//        arrayList.add("tom");
//        HashMap hashMap = new HashMap();
//        hashMap.put("NO1", "北京");
//        hashMap.put("NO2", "上海");
        List list = new ArrayList();
        list.add("jack");
        list.add(10);
        list.add(true);
        System.out.println("list=" + list);
//        list.remove(0);
        list.remove(true);
        System.out.println("list=" + list);
        System.out.println(list.contains("jack"));
        System.out.println(list.size());
        System.out.println(list.isEmpty());
        list.clear();
        System.out.println(list.isEmpty());

        ArrayList list1 = new ArrayList();
        list1.add("红楼梦");
        list1.add("三国演义");
        list1.addAll(list1);
        System.out.println(list1);
        System.out.println(list.containsAll(list1));
        System.out.println(list1.isEmpty());
        System.out.println(list1.removeAll(list1));
        System.out.println(list1.isEmpty());
    }
}
